Skip to content

cannot install version 2.7.4 on SmartOS #677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dn0 opened this issue Feb 16, 2018 · 10 comments
Closed

cannot install version 2.7.4 on SmartOS #677

dn0 opened this issue Feb 16, 2018 · 10 comments
Milestone

Comments

@dn0
Copy link

dn0 commented Feb 16, 2018

  • SmartOS base-64 2017Q4
  • Python 3.6
  • PostgreSQL 10.1

pip install psycopg2==2.7.4 fails (2.7.3 installs fine):

gcc -Wno-unused-result -Wsign-compare -DNDEBUG -pipe -O2 -D_FORTIFY_SOURCE=2 -I/usr/include -I/opt/local/include -I/opt/local/include/ncurses -I/opt/local/include/db4 -pipe -O2 -D_FORTIFY_SOURCE=2 -I/usr/include -I/opt/local/include -I/opt/local/include/ncurses -I/opt/local/include/db4 -pipe -O2 -D_FORTIFY_SOURCE=2 -I/usr/include -I/opt/local/include -I/opt/local/include/ncurses -I/opt/local/include/db4 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.4 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=100001 -DHAVE_LO64=1 -I/opt/snakepit-mgmt/env/include -I/opt/local/include/python3.6 -I. -I/opt/local/include -I/opt/local/include/postgresql/server -c psycopg/pqpath.c -o build/temp.solaris-2.11-i86pc.64bit-3.6/psycopg/pqpath.o
    In file included from /usr/include/sys/select.h:53:0,
                     from /usr/include/sys/types.h:631,
                     from /usr/include/sys/wait.h:37,
                     from /usr/include/stdlib.h:42,
                     from /opt/local/include/python3.6/Python.h:34,
                     from ./psycopg/psycopg.h:34,
                     from psycopg/pqpath.c:33:
    psycopg/solaris_support.h:33:20: error: expected identifier or '(' before 'do'
     extern HIDDEN void timeradd(struct timeval *a, struct timeval *b, struct timeval *c);
                        ^
    psycopg/solaris_support.h:33:20: error: expected identifier or '(' before 'while'
     extern HIDDEN void timeradd(struct timeval *a, struct timeval *b, struct timeval *c);
                        ^
    psycopg/solaris_support.h:34:20: error: expected identifier or '(' before 'do'
     extern HIDDEN void timersub(struct timeval *a, struct timeval *b, struct timeval *c);
                        ^
    psycopg/solaris_support.h:34:20: error: expected identifier or '(' before 'while'
     extern HIDDEN void timersub(struct timeval *a, struct timeval *b, struct timeval *c);
                        ^
    error: command 'gcc' failed with exit status 1
@dvarrazzo
Copy link
Member

Never heard of SmartOS before.

The breakage comes from #606. Please provide a patch to fix it without breaking Solaris 10, thank you.

@twhiteman
Copy link

I think SmartOS already defines the timeradd and timersub (as macros in /usr/include/sys/time.h) - so maybe you can wrap with an !defined check around the #606 code parts:

#if defined(__sun) && defined(__SVR4)
#include <sys/time.h>

#if !defined(timeradd)
extern HIDDEN void timeradd(struct timeval *a, struct timeval *b, struct timeval *c);
#endif
...

@mgerdts
Copy link
Contributor

mgerdts commented Feb 16, 2018

A potential fix at mgerdts@eb711c7

@dvarrazzo
Copy link
Member

Please, no maybe. I understand what the fix is, but I cannot test it. Just submit a merge request after you tested it worked.

@dn0
Copy link
Author

dn0 commented Feb 17, 2018

@dvarrazzo I understand. Since psycopg2 is now broken on all illumos distributions and probably also on Solaris 11, we should join our forces here and test it properly on all SunOS variants.

I've just deployed @mgerdts 's patch on a fairly recent SmartOS system, by running:

pip install -U https://github.com/mgerdts/psycopg2/tarball/master

and it was installed correctly and the application runs without any problems.

@mykarlsson , @justin-wf can you please test this on Solaris 10?

@ghost
Copy link

ghost commented Feb 17, 2018

The patch works for me on Solaris 10.

@dvarrazzo
Copy link
Member

Thank you very much for the collaboration. I will merge the patch and create a debug release soon. In the meantime I think you can specify something like psycopg2>=2.7,<2.8,!=2.7.4 in your requirement files to avoid the broken release.

@dn0 if you Illumos guys are interested in setting up a CI system to validate future versions let me know. Otherwise bugs will only be founds after the releases (think if in a future release those macros become real functions...)

@dvarrazzo dvarrazzo added this to the psycopg 2.7.5 milestone Feb 19, 2018
@dn0
Copy link
Author

dn0 commented Feb 19, 2018

@mykarlsson Thanks.
@dvarrazzo Thanks.
Regarding the CI: I cannot promise anything, but I will have a look into this. There are probably also other Python projects that may have problems supporting illumos just because there is no CI service for this. If that is the case then this is something that should be solved.

@gaige
Copy link

gaige commented Mar 15, 2018

@dvarrazzo @dn0
We're heavy SmartOS users at ClueTrust and I'd be happy to set up a CI system for this on one of our systems.

@dn0
Copy link
Author

dn0 commented Mar 15, 2018

@gaige That would be awesome. I didn't have time to think about this, but I suppose the API should be similar to Travis CI or at least compatible with GitHub...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants